package com.kocel.block.model;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "tb_user", schema = "dbo", catalog = "Block")
public class TbUser {
    private String objId;
    private String userName;
    private String password;
    private String role;
    private String depart;
    private String employNumber;
    private String mobile;
    private String email;

    @Id
    @Column(name = "objId")
    public String getObjId() {
        return objId;
    }

    public void setObjId(String objId) {
        this.objId = objId;
    }

    @Basic
    @Column(name = "userName")
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Basic
    @Column(name = "password")
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Basic
    @Column(name = "role")
    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    @Basic
    @Column(name = "depart")
    public String getDepart() {
        return depart;
    }

    public void setDepart(String depart) {
        this.depart = depart;
    }

    @Basic
    @Column(name = "employNumber")
    public String getEmployNumber() {
        return employNumber;
    }

    public void setEmployNumber(String employNumber) {
        this.employNumber = employNumber;
    }

    @Basic
    @Column(name = "mobile")
    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    @Basic
    @Column(name = "email")
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TbUser tbUser = (TbUser) o;
        return Objects.equals(objId, tbUser.objId) &&
                Objects.equals(userName, tbUser.userName) &&
                Objects.equals(password, tbUser.password) &&
                Objects.equals(role, tbUser.role) &&
                Objects.equals(depart, tbUser.depart) &&
                Objects.equals(employNumber, tbUser.employNumber) &&
                Objects.equals(mobile, tbUser.mobile) &&
                Objects.equals(email, tbUser.email);
    }

    @Override
    public int hashCode() {
        return Objects.hash(objId, userName, password, role, depart, employNumber, mobile, email);
    }
}
